package token.mobileapp.controlactivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import token.mobileapp.R;
import token.mobileapp.TokenActivity;

/**
 * token.mobileapp.controlactivity
 * Author: AVAVT
 * Date: 7/11/11
 * Time: 1:53 AM
 */
public class MainMenu extends TokenActivity implements View.OnClickListener {
    private Button buttonViewCode, buttonChangePIN, buttonHelp,
            buttonChangeSecret, buttonAttachAccount;

    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_menu);
        buttonViewCode = (Button) findViewById(R.id.mainpg_btn_code);
        buttonViewCode.setOnClickListener(this);

        buttonAttachAccount = (Button) findViewById(R.id.mainpg_btn_attach);
        buttonAttachAccount.setOnClickListener(this);

        buttonChangeSecret = (Button) findViewById(R.id.mainpg_btn_secret);
        buttonChangeSecret.setOnClickListener(this);

        buttonChangePIN = (Button) findViewById(R.id.mainpg_btn_pin);
        buttonChangePIN.setOnClickListener(this);

        buttonHelp = (Button) findViewById(R.id.mainpg_btn_help);
        buttonHelp.setOnClickListener(this);
    }

    public void onClick(View v) {
        if (v.getId() == R.id.mainpg_btn_code) {
            Intent intent = new Intent(this, ViewCode.class);
            startActivity(intent);
        }
        else if(v.getId() == R.id.mainpg_btn_attach) {
            Intent intent = new Intent(this, AttachAccount.class);
            startActivity(intent);
        }
        else if(v.getId() == R.id.mainpg_btn_secret) {
            Intent intent = new Intent(this, ChangeSecretKey.class);
            startActivity(intent);
        }
        else if(v.getId() == R.id.mainpg_btn_pin) {
            Intent intent = new Intent(this, ChangePIN.class);
            startActivity(intent);
        }
        else if
            (v.getId() == R.id.mainpg_btn_help) {
            Intent intent = new Intent(this, Help.class);
            startActivity(intent);
        }
    }
}
